home *** CD-ROM | disk | FTP | other *** search
/ PD ROM 1 / PD ROM Volume I - Macintosh Software from BMUG (1988).iso / Telecommunications / Term Programs / Emacs Folder / emacs.rc < prev    next >
Encoding:
Text File  |  1988-03-14  |  4.9 KB  |  205 lines  |  [TEXT/Earl]

  1. ;    EMACS.RC:    Startup file for MicroEMACS 3.8
  2. ;
  3. ;            This file is executed everytime the
  4. ;            editor is entered
  5.  
  6. ;If you have a keyboard with an escape key or a clear key, you may
  7. ;remove or comment out the next line or two.  (I have a Mac Plus
  8. ;keyboard myself, but I don't like the position of the clear=escape
  9. ;key too much.)
  10.  
  11. ;bind-to-key meta-prefix `
  12. ;bind-to-key execute-named-command ^[
  13.  
  14. ;    ***** Rebind the Function key group
  15.  
  16. ;bind-to-key search-forward        FN1
  17. ;bind-to-key search-reverse        FN2
  18. ;bind-to-key hunt-forward        FN3
  19. ;bind-to-key hunt-backward        FN4
  20. ;bind-to-key next-window        FN5
  21. ;bind-to-key execute-macro        FN6
  22. ;bind-to-key find-file            FN7
  23. ;bind-to-key execute-file        FN8
  24. ;bind-to-key save-file            FN9
  25. ;bind-to-key exit-emacs            FN0
  26.  
  27.  
  28. ;    toggle function key window off
  29. 1 store-macro
  30.     save-window
  31.     1 next-window
  32.     !if &sequal "Function Keys" $cbufname
  33.         delete-window
  34.     !endif
  35.     bind-to-key execute-macro-14 M-T
  36. !force    restore-window
  37.     write-message "[Function key window OFF]"
  38. !endm
  39. bind-to-key execute-macro-1 M-T
  40. ;    toggle function key window back on
  41. 14 store-macro
  42.     1 next-window
  43.     !if &sequal $cbufname "emacs.hlp"
  44.         execute-macro-11
  45.     !endif
  46.     !if ¬ &sequal $cbufname "Function Keys"
  47.         1 split-current-window
  48.         select-buffer "Function Keys"
  49. !force        5 resize-window
  50.         beginning-of-file
  51.     !endif
  52.     bind-to-key execute-macro-1 M-T
  53.     2 next-window
  54.     write-message "[Function key window ON]"
  55. !endm
  56.  
  57. ;    Enter Help
  58. 2 store-macro
  59.     1 next-window        ;Make sure the function key window isn't up!
  60.     !if &sequal $cbufname "Function Keys"
  61.         delete-window
  62.         bind-to-key execute-macro-14 M-T
  63.     !endif
  64.     help
  65.     8 resize-window
  66.     bind-to-key execute-macro-12 ^Z
  67.     bind-to-key execute-macro-13 ^V
  68.     bind-to-key execute-macro-11 M-?
  69.     bind-to-key execute-macro-15 ^XO
  70.     bind-to-key execute-macro-15 ^XP
  71.     bind-to-key execute-macro-15 FN5
  72.     beginning-of-file
  73.     2 forward-character
  74.     clear-message-line
  75. !endm
  76. bind-to-key execute-macro-2 M-?
  77. ;    Exit Help
  78. 11 store-macro
  79.     bind-to-key previous-page ^Z
  80.     bind-to-key next-page ^V
  81.     bind-to-key execute-macro-2 M-?
  82.     bind-to-key next-window ^XO
  83.     bind-to-key previous-window ^XP
  84.     bind-to-key next-window FN5
  85.     delete-window
  86.     clear-message-line
  87. !endm
  88.  
  89. ;    don't allow these commands from within the HELP screen
  90. 15    store-macro
  91.     write-message "[Use M-? to exit HELP]!!"
  92. !endm
  93.  
  94. ;    last help page
  95. 12 store-macro
  96.     beginning-of-line
  97.     search-reverse "=>"
  98.     1 redraw-display
  99. !endm
  100.  
  101. ;    next help page
  102. 13 store-macro
  103.     beginning-of-line
  104.     2 forward-character
  105.     search-forward "=>"
  106.     1 redraw-display
  107. !endm
  108.  
  109. ;    reformat indented paragraph
  110.  
  111. 6 store-macro
  112.     write-message "                    [Fixing paragraph]"
  113.     kill-region
  114.     2 split-current-window
  115.     select-buffer "[temp]"
  116.     yank
  117.     beginning-of-file
  118.     replace-string "~n    " "~n"
  119.     write-message "                    [Fixing paragraph]"
  120.     66 set-fill-column
  121.     write-message "                    [Fixing paragraph]"
  122.     fill-paragraph
  123.     77 set-fill-column
  124.     beginning-of-file
  125.     handle-tab
  126.     replace-string ~n "~n    "
  127.     write-message "                    [Fixing paragraph]"
  128.     end-of-file
  129.     2 delete-previous-character
  130.     beginning-of-file
  131.     set-mark
  132.     write-message "                    [Fixing paragraph]"
  133.     end-of-file
  134.     kill-region
  135.     unmark-buffer
  136.     delete-window
  137.     yank
  138.     delete-buffer "[temp]"
  139.     write-message "                    [Fixed paragraph]"
  140. !endm
  141. bind-to-key execute-macro-6 ^XQ
  142. ;    indent region
  143.  
  144. 7 store-macro
  145.     write-message "                    [Indenting region]"
  146.     kill-region
  147.     2 split-current-window
  148.     select-buffer "[temp]"
  149.     yank
  150.     beginning-of-file
  151.     handle-tab
  152.     replace-string "~n" "~n    "
  153.     end-of-file
  154.     4 delete-previous-character
  155.     beginning-of-file
  156.     set-mark
  157.     write-message "                    [Indenting region]"
  158.     end-of-file
  159.     kill-region
  160.     unmark-buffer
  161.     delete-window
  162.     yank
  163.     delete-buffer "[temp]"
  164.     write-message "                    [Region Indented]"
  165. !endm
  166. bind-to-key execute-macro-7 ^XI
  167. ;    undent region
  168.  
  169. 8 store-macro
  170.     write-message "                    [Undenting region]"
  171.     kill-region
  172.     2 split-current-window
  173.     select-buffer "[temp]"
  174.     yank
  175.     beginning-of-file
  176.     delete-next-character
  177.     replace-string "~n    " "~n"
  178.     end-of-file
  179.     2 delete-previous-character
  180.     beginning-of-file
  181.     set-mark
  182.     write-message "                    [Undenting region]"
  183.     end-of-file
  184.     kill-region
  185.     unmark-buffer
  186.     delete-window
  187.     yank
  188.     delete-buffer "[temp]"
  189.     write-message "                    [Region undented]"
  190. !endm
  191. bind-to-key execute-macro-8 ^XU
  192. ;    bring up the function key window
  193.  
  194.     1 split-current-window
  195.     select-buffer "Function Keys"
  196.     5 resize-window
  197.     insert-string "^1 search      ^2 search back | M-T toggle function list M-? help (toggle)~n"
  198.     insert-string "^3 hunt        ^4 hunt back   | M-A find command/apropos ^X? describe key~n"
  199.     insert-string "^5 next window ^6 exec macro  | M-Q reformat paragraph   ^XQ ref undented region~n"
  200.     insert-string "^7 find file   ^8 desc keys   | ^Xi indent region        ^XU undent region~n"
  201.     insert-string "^9 save file   ^0 exit emacs  | M-, show memory          M-X extended command~n"
  202.     beginning-of-file
  203.     unmark-buffer
  204.     next-window
  205.